﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Drawing;

namespace xEditor
{
    public enum ParticleType { pt_Line, pt_Point, pt_Triangle, pt_pointSprites, pt_Ring };
    public enum ParticleBlending { pb_Additive, pb_Alpha };
    public enum ParticleTexture { ptx_A };

    public class Particle
    {
        private int _count;
        private ParticleType _type;
        private ParticleTexture _texture;
        private ParticleBlending _blending;
        private double _mass;
        private Color _startColor;
        private Color _endColor;
        private int _lifeTime;
        private int _billboarding;
        
        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Count")]
        public int Count
        {
            get { return _count; }
            set { _count = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Type")]
        public ParticleType Type
        {
            get { return _type; }
            set { _type = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Texture")]
        public ParticleTexture Texture
        {
            get { return _texture; }
            set { _texture = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Blending")]
        public ParticleBlending Blending
        {
            get { return _blending; }
            set { _blending = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Mass")]
        public double Mass
        {
            get { return _mass; }
            set { _mass = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Start Color")]
        public Color StartColor
        {
            get { return _startColor; }
            set { _startColor = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle End Color")]
        public Color EndColor
        {
            get { return _endColor; }
            set { _endColor = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Life Time")]
        public int LifeTime
        {
            get { return _lifeTime; }
            set { _lifeTime = value; }
        }

        [CategoryAttribute("Particle"), DescriptionAttribute("Particle Billboarding")]
        public int Billboarding
        {
            get { return _billboarding; }
            set { _billboarding = value; }
        }

        /*
         * 
         * Emitter Properties
         * 
         */
        private double _translation;
        private double _rotation;
        private double _scale;
        private ParticleType _shape;

        [CategoryAttribute("Emitter"), DescriptionAttribute("Emitter Translation.")]
        public double Translation
        {
            get { return _translation; }
            set { _translation = value; }
        }

        [CategoryAttribute("Emitter"), DescriptionAttribute("Emitter Rotation.")]
        public double Rotation
        {
            get { return _rotation; }
            set { _rotation = value; }
        }
        [CategoryAttribute("Emitter"), DescriptionAttribute("Emitter Scale.")]
        public double Scale
        {
            get { return _scale; }
            set { _scale = value; }
        }
        [CategoryAttribute("Emitter"), DescriptionAttribute("Emitter Shape.")]
        public ParticleType Shape
        {
            get { return _shape; }
            set { _shape = value; }
        }

        /*
         * 
         * Emission Properties
         * 
         */

        private double _direction;
        private double _minAngle;
        private double _maxAngle;
        private double _initialVelocity;

        [CategoryAttribute("Emission"), DescriptionAttribute("Emission Direction.")]
        public double Direction
        {
            get { return _direction; }
            set { _direction = value; }
        }

        [CategoryAttribute("Emission"), DescriptionAttribute("Emission Minimum Direction Angle.")]
        public double MinAngle
        {
            get { return _minAngle; }
            set { _minAngle = value; }
        }
        [CategoryAttribute("Emission"), DescriptionAttribute("Emission Maximum Direction Angle.")]
        public double MaxAngle
        {
            get { return _maxAngle; }
            set { _maxAngle = value; }
        }
        [CategoryAttribute("Emission"), DescriptionAttribute("Emission Initial Velocity.")]
        public double InitialVelocity
        {
            get { return _initialVelocity; }
            set { _initialVelocity = value; }
        }

        /*
         * 
         * Flow Properties
         * 
         */
        private bool _regulation;
        private int _maxPPS;
        private bool _respawn;

        [CategoryAttribute("Flow"), DescriptionAttribute("Enable or disable the regulation of Particles.")]
        public bool Regulation
        {
            get { return _regulation; }
            set { _regulation = value; }
        }
        [CategoryAttribute("Flow"), DescriptionAttribute("Set the maximum particles per second.")]
        public int MaxPPS
        {
            get { return _maxPPS; }
            set { _maxPPS = value; }
        }
        [CategoryAttribute("Flow"), DescriptionAttribute("Enable or disable the re-spawning of dead Particles.")]
        public bool Respawn
        {
            get { return _respawn; }
            set { _respawn = value; }
        }

    }
}
